package com.eonmind.common.provider.entity.knowledge;

import com.eonmind.common.contract.enums.DelEnum;
import com.eonmind.common.contract.enums.knowledge.FileUploadStatusEnum;
import com.eonmind.common.contract.timer.Timer;
import com.mongoplus.annotation.ID;
import com.mongoplus.annotation.collection.CollectionName;
import com.mongoplus.annotation.index.MongoIndex;
import com.mongoplus.enums.IdTypeEnum;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.FieldNameConstants;

/**
 * 文件上传表
 */
@Data
@CollectionName("fileUpload")
@FieldNameConstants
@ToString
public class KnowledgeUploadFile {
    /**
     * 上传文件ID
     */
    @ID(type = IdTypeEnum.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    @MongoIndex
    private Long userId = 0L;

    /**
     * 知识库ID
     */
    @MongoIndex
    private Long knowledgeId = 0L;

    /**
     * 文档真实名称
     */
    @MongoIndex
    private String realName = "";

    /**
     * 文档原始名称
     */
    @MongoIndex
    private String originalName = "";

    /**
     * 文档大小
     */
    private Long fileSize = 0L;

    /**
     * 文档上传状态
     */
    @MongoIndex
    private Integer fileStatus = FileUploadStatusEnum.UPLOAD_SUCCESSFULLY.getCode();

    /**
     * 删除状态
     */
    @MongoIndex
    private Integer del = DelEnum.UN_DEL.getCode();

    /**
     * 创建时间
     */
    private Long createTime = Timer.currentTimestamp();

    /**
     * 更新时间
     */
    private Long updateTime = Timer.currentTimestamp();
}
